DROP TABLE PHP_GALERIE;

CREATE TABLE PHP_GALERIE(
  ID NUMBER(5) PRIMARY KEY,
  URL VARCHAR2(300) UNIQUE,
  DESCRIPTION_FRANCAIS VARCHAR2(500),
  DESCRIPTION_ANGLAIS VARCHAR2(500),
  ALT_FRANCAIS VARCHAR2(200),
  ALT_ANGLAIS VARCHAR2(200));
  
  
  CREATE OR REPLACE TRIGGER "A8VALOIPH"."PHP_TRIGGALERIE" before insert on "PHP_GALERIE"    for each row begin     if inserting then       if :NEW."ID" is null then          select PHPSEQ.nextval into :NEW."ID" from dual;       end if;    end if; end;
/
ALTER TRIGGER "A8VALOIPH"."PHP_TRIGGALERIE" ENABLE;
 

  
INSERT INTO PHP_GALERIE
  (URL, description_francais, description_anglais, alt_francais, alt_anglais)
  VALUES('http://cdn2.maxim.com/maxim/files/2009/10/20/ithe-hangoveris-heather-graham/ch-lingerie.jpg','Une belle p''tite dame','A nice hottie','Chaudasse','Hottie');
INSERT INTO "A8VALOIPH"."PHP_GALERIE" (URL, DESCRIPTION_FRANCAIS, DESCRIPTION_ANGLAIS, ALT_FRANCAIS, ALT_ANGLAIS) VALUES ('http://img.alibaba.com/photo/11149679/Thai_Fruits_Mango_Guava_Baby_Banana_Pineapple_.jpg', 'Des fruits', 'Fruits', 'Fruits', 'Fruits')
INSERT INTO "A8VALOIPH"."PHP_GALERIE" (URL, DESCRIPTION_FRANCAIS, DESCRIPTION_ANGLAIS, ALT_FRANCAIS, ALT_ANGLAIS) VALUES ('http://smartcanucks.ca/wp-content/uploads/2009/09/tip_steak.jpg', 'Un steak', 'A SteaK', 'Steak', 'Steak')
INSERT INTO "A8VALOIPH"."PHP_GALERIE" (URL, DESCRIPTION_FRANCAIS, DESCRIPTION_ANGLAIS, ALT_FRANCAIS, ALT_ANGLAIS) VALUES ('http://zestycook.com/wp-content/uploads/2009/02/tomato_pepper_pasta1.jpg', 'Des pates', 'Pasta', 'Pates', 'Pasta')
INSERT INTO "A8VALOIPH"."PHP_GALERIE" (URL, DESCRIPTION_FRANCAIS, DESCRIPTION_ANGLAIS, ALT_FRANCAIS, ALT_ANGLAIS) VALUES ('http://jafred.files.wordpress.com/2009/11/dessert.jpg', 'Dessert', 'Desset', 'Dessert', 'Dessert')

commit;